<template>
  <div>
    <top-movie :arr="toparr"><p class="title">最受好评电影</p></top-movie>
    <list :hot="oldArr"></list>
    <list :hot="newArr"></list>
  </div>
</template>

<script>
import TopMovie from "../../components/TopMovie";
import List from "../../components/List";
export default {
  name: "ReYing",
  components: {
    TopMovie,
    List,
  },
  data() {
    return {
      oldArr: [],
      newArr: [],
      toparr: [],
    };
  },
  async created() {
    let res = await this.$axios.get("./json/movieOnInfoList.json");
    this.oldArr = res.data.movieList;
    this.oldArr.forEach((item) => {
      item.img = item.img.replace("w.h", "64.90");
    });
    let r = await this.$axios.get(
      "/api/mmdb/movie/v3/list/hot.json?ct=%E6%B7%B1%E5%9C%B3&ci=30&channelId=4"
    );
    this.newArr = r.data.data.hot;
    this.toparr = r.data.data.hot.sort((a, b) => {
      return b.sc - a.sc;
    });
  },
};
</script>

<style scoped>
.title {
  width: 9.2rem;
  height: 21px;
  font-size: 14px;
  color: #333;
  line-height: 21px;
  margin-bottom: 12px;
}
</style>